package com.company.indicationshots.util;

import com.company.indicationshots.model.Score;

import java.util.List;
//计算多个坐标的中心坐标
public class CenterOfPoints {
    public static Score calculateCenter(List<Score> scoreList) {
        float sumX = 0;
        float sumY = 0;

        for (Score point : scoreList) {
            sumX += point.getX();
            sumY += point.getY();
        }

        float centerX = sumX / scoreList.size();
        float centerY = sumY / scoreList.size();

        return new Score(0,0,null,null,centerX, centerY,0);
    }
}
